Skip to content

Lexer - new error handling#9480

Closed
jacob-carlborg wants to merge 15 commits intodlang:masterfrom
jacob-carlborg:lexer-diagnostics
Closed

Lexer - new error handling#9480
jacob-carlborg wants to merge 15 commits intodlang:masterfrom
jacob-carlborg:lexer-diagnostics

Conversation

@jacob-carlborg
Copy link
Contributor

This changes the error handling from just printing errors directly to collecting them and returning them to the caller. The main motivation is to be able to make as much of the lexer pure, to remove any global state to make the compiler more useable as a library.

This is a draft PR. The commits are quite messy. Some things can be extracted into separate PRs. Some things will be moved to other modules. But the end result is kind of what I want it to look like. To reduce the number of changes the parser contains a few wrapper functions which calls the corresponding functions in the lexer and immediately prints any errors returned from the lexer. Ideally, in the future, the parser would use the same technique to push the errors further up the call stack.

@dkorpel
Copy link
Contributor

dkorpel commented May 10, 2023

Closing this as superseded by #14906

@dkorpel dkorpel closed this May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants